//
//  UILabel+Extension.swift
//  weibo
//
//  Created by Fosen on 15/12/3.
//  Copyright © 2015年 fosen. All rights reserved.
//

import UIKit

extension UILabel{
    
    convenience init(title: String,color: UIColor,fontSize:CGFloat,margin:CGFloat = 0){
        self.init()
        
        text = title
        textColor = color
        font = UIFont.systemFontOfSize(fontSize)
        textAlignment = NSTextAlignment.Center
        if margin > 0 {
            preferredMaxLayoutWidth = screenW - 2 * margin
            textAlignment = NSTextAlignment.Left
        }
        numberOfLines = 0
        sizeToFit()
    
    
    }




}
